<template>
  <div class="searchBox">
    <el-input v-model="searchInput" placeholder="请输入内容" size="small" @keyup.enter="searchChangeSub" />
    <div style="margin-top:10px;">
      <el-button type="primary" icon="el-icon-search" size="small" @click="clickSearchSub">搜索</el-button>
      <el-button type="info" size="small" plain @click="clickReastSub">重置</el-button>
    </div>
  </div>
</template>

<script>
export default {
  name: 'FilterInputSub',
  props: {
    params: {
      type: String,
      default: () => ''
    }
  },
  data() {
    return {
      searchInput: this.params
    };
  },
  methods: {
    searchChangeSub() {
      this.$emit('searchChangeSub', this.searchInput);
    },
    clickSearchSub() {
      this.$emit('searchChangeSub', this.searchInput);
    },
    clickReastSub() {
      this.searchInput = '';
      this.$emit('searchChangeSub', '');
    }
  }
};
</script>

<style lang="scss" scoped>
.searchBox{
  padding: 12px;
}
</style>
